package org.example.Controller;

import jakarta.annotation.Resource;
import org.example.common.Result;
import org.example.pojo.Collect;
import org.example.service.CollectService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("collect")
public class CollectController {
    @Resource
    private CollectService collectService;
    @PostMapping("/select")
    public Result select(Integer userId,Integer businessId){
        Result result=collectService.iscollect(userId,businessId);
        return result;

    }
    @PostMapping("/add")
    public Result add(@RequestBody Collect collect){
        Result result=collectService.add(collect);
        return result;
    }
    @PostMapping("/reset")
    public Result reset(Integer userId,Integer businessId){
        Result result=collectService.shanchu(userId,businessId);
        return result;
    }
    @PostMapping("/getall")
    public Result getall(Integer userId){
        Result result=collectService.getall(userId);
        return result;
    }
}
